from com.mysqlconnection import mysql_connect
from  init_cs import dictfetchall
listtemplates_sql='SELECT v.id,v.NAME,v.TYPE,v.FORMAT,v.account_id,th.install_path FROM vm_template AS v,template_host_ref AS th WHERE th.template_id=v.id AND v.removed IS NULL AND TYPE !="SYSTEM"'

    
def get_all_templates_list():
    cnn=mysql_connect()
    cnn.execute(listtemplates_sql)
    return dictfetchall(cnn)